# 匿名函数
#1
sum1 = lambda a, b: a + b
print(type(sum1))
print(sum1(10, 20))

#2
lst = [10, 20, 30, 40, 50]
for i1 in range(len(lst)):
    result = lambda x: x[i1]
    print(result(lst))

#3
student_scores = [
    {'name': '陈梅梅', 'score': 98},
    {'name': '王一一', 'score': 95},
    {'name': '张天乐', 'score': 100},
    {'name': '白雪儿', 'score': 65}
]
student_scores.sort(key=lambda x: x.get('score'), reverse=True)
print(student_scores)